<?php

class GaleriasController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // action body
        $this->view->headScript()->appendFile('/js/jquery.pajinate.js');
		$request = $this->getRequest();
        $galeriaID = $request->getParam('id', 0);
        $galeriasObj = new Application_Model_Galeria();
        $galeria = $galeriasObj->getById($galeriaID);

        $this->view->galeria = $galeria[0];
		
		$obj_noticias = new Application_Model_Noticia();
		$noticias_footer = $obj_noticias->getLastLimit(2);
		$this->view->noticias_footer = $noticias_footer;
		
		$obj_videos = new Application_Model_Video();
		$video_footer = $obj_videos->getLastVideo();
		$this->view->video_footer = $video_footer[0];
		
		$obj_cartones = new Application_Model_Carton();
		$carton_footer = $obj_cartones->getLastCarton();
		$this->view->carton_footer = $carton_footer;
    }

    public function listaAction()
    {
        // action body
		$this->view->headScript()->appendFile('/js/jquery.pajinate.js');
        $galeriasObj = new Application_Model_Galeria();
        $galerias = $galeriasObj->getGalerias();

        $this->view->galerias = $galerias;
		
		$obj_noticias = new Application_Model_Noticia();
		$noticias_footer = $obj_noticias->getLastLimit(2);
		$this->view->noticias_footer = $noticias_footer;
		
		$obj_videos = new Application_Model_Video();
		$video_footer = $obj_videos->getLastVideo();
		$this->view->video_footer = $video_footer[0];
		
		$obj_cartones = new Application_Model_Carton();
		$carton_footer = $obj_cartones->getLastCarton();
		$this->view->carton_footer = $carton_footer;
    }


}



